<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>箭头函数与普通函数的区别</h2>
</body>
<script>
    var name = 1
    var obj = {
        name: 'alice',
        getName:()=> {
            console.log('this===obj:',this===obj)
            //let _this=this;
            setTimeout(()=> {
                console.log('this===window:', this.name) //window,obj,undefined
            },0)
        }
    }

    var fn=()=>{
        console.log(arguments[0])
        console.log(arguments[1])
        console.log(arguments[2])
    }

    fn(1,2,3)
</script>

</html>